using System;
using System.Runtime.InteropServices;
using Scenario.WAPI.Exception;

namespace Scenario.WAPI
{
	public partial class Session
	{
        public Session()
        {
        }

        public void Start(String configurationFile)
        {
            Response wapiResponse = new Response();

            if (configurationFile.Equals(String.Empty))
                Session.InitSession(ref wapiResponse);
            else
                Session.InitSessionWithParams(configurationFile, ref wapiResponse);

            if (wapiResponse.iCode != 0)
                throw new WAPI.Exception.WAPIException(wapiResponse);
        }

        public void End()
        {
            Response wapiResponse = new Response();

            Session.EndSession(ref wapiResponse);

            if (wapiResponse.iCode != 0)
                throw new WAPI.Exception.WAPIException(wapiResponse);
        }
	}
}
